<?php
/**
 * Created by PhpStorm.
 * User: steven
 * Date: 2017/11/22
 * Time: 下午11:00
 */

namespace app\api\service;


class Token {
    public static function generateToken(){
        // 32个字符组成一组随机的字符串
        $randChars = getRandChars(32);
        // 用三组字符串，进行md5加密
        $timestamp = $_SERVER('REQUEST_TIME_FLOAT');
        // salt
        $salt      = config('secure.token_salt');

        return md5($randChars+$timestamp+$salt);

    }
}